//
//  QINPopUpTool.h
//  qkProject
//
//  Created by Q on 2022/12/12.
//  Copyright © 2022 XLkeji. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, QINAlertPopUpStyle) {
    QINAlertPopUpStyleCenter,
    QINAlertPopUpStyleBottom,
    QINAlertPopUpStyleNone
};

typedef NS_ENUM(NSUInteger, BeforeAlertBehavior) {
    BeforeAlertBehaviorClose,
    BeforeAlertBehaviorHidden,
    BeforeAlertBehaviorNode
};




@interface QINPopUpTool : NSObject

@property (nonatomic, strong) UIColor *bgColor;

+ (instancetype)sharedInstance;


/// 弹窗
/// - Parameters:
///   - view: 要展示的view
///   - animation: 弹出位置
///   - canTapBgCancel: 点击空白处移除
///   - closeBefore: 之前弹框的处理方式
- (void)popUpWithView:(UIView *)view withAnimation:(QINAlertPopUpStyle)animation withCanTapBgCancel:(BOOL)canTapBgCancel closeBefore:(BeforeAlertBehavior)closeBefore;

/// 可以隐藏view的弹框
/// - Parameters:
///   - view: 要展示的view
///   - animation: 弹出位置
///   - canTapBgCancel: 点击背景是否隐藏view
///   - closeBefore: 之前弹框的处理方式
- (void)popUpWithView:(UIView *)view withAnimation:(QINAlertPopUpStyle)animation closeBefore:(BeforeAlertBehavior)closeBefore;

/// 弹窗
/// - Parameters:
///   - view: 要展示的view
///   - animation: 动画
///   - canTapBgCancel: 点击空白处移除
///   - bgColor: 设置背景色
- (void)popUpWithView:(UIView *)view withAnimation:(QINAlertPopUpStyle)animation withCanTapBgCancel:(BOOL)canTapBgCancel closeBefore:(BeforeAlertBehavior)closeBefore  bgColor:(UIColor *)bgColor;

/// 弹窗
/// - Parameters:
///   - view: 要展示的view
///   - toCtl: 展示到哪个控制器上
///   - animation: 动画
///   - canTapBgCancel: 点击空白处移除
///   - closeBefore: 之前弹框的处理方式
- (void)popUpWithView:(UIView *)view withToViewCtl: (UIViewController *) toCtl withAnimation:(QINAlertPopUpStyle)animation withCanTapBgCancel:(BOOL)canTapBgCancel closeBefore:(BeforeAlertBehavior)closeBefore;

// 外部主动删除toast
- (void)removePopUpViewWhenAppearOther;
// 删除所有Alert
- (void)clear;
/// 移除屏幕最上层的view
- (void)removePopUpView;

/// 隐藏当前显示的view
- (void)hiddenCurrentPopUpView;
/// 显示当前隐藏的view
- (void)showCurrentPopUpView;

@end

NS_ASSUME_NONNULL_END
